//
//  DKCalendarConfiguration.h
//  Whistle
//
//  Created by ZhangAo on 2018/2/4.
//  Copyright © 2018年 BookSir. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DKCalendarCellViewModel.h"
#import "DKCalendarConstants.h"

@protocol WBCalendarDelegate <NSObject>

- (NSInteger)calendarNumberOfSection;

- (NSInteger)calendarNumberOfItemsInSection:(NSInteger)section;

- (UICollectionViewCell *)fetchCollectionViewCell:(UICollectionView *)collectionView
                           cellForItemAtIndexPath:(NSIndexPath *)indexPath;

- (UICollectionReusableView *)calendarCollectionView:(UICollectionView *)collectionView
                   viewForSupplementaryElementOfKind:(NSString *)kind
                                         atIndexPath:(NSIndexPath *)indexPath;

- (UIEdgeInsets)calendarCollectionView:(UICollectionView *)collectionView
                                layout:(UICollectionViewLayout *)collectionViewLayout
                insetForSectionAtIndex:(NSInteger)section;

- (void)registerCells:(UICollectionView *)collectionView;

- (void)registerSectionHeaderViews:(UICollectionView *)collectionView;

- (NSDate *)dateFromIndexPath:(NSIndexPath *)indexPath;

- (NSIndexPath *)indexPathFromDate:(NSDate *)date;

- (NSArray<NSDate *> *)mappingRangeDate:(NSDate *)date;

- (UICollectionViewFlowLayout *)layout;

@end

@interface DKCalendarConfiguration : NSObject <WBCalendarDelegate>

@property (nonatomic, strong) NSDate *minimumDate; // 最小可选时间
@property (nonatomic, strong) NSDate *maximumDate; // 最大可选时间
@property (nonatomic, assign) DKCalendarSelectType selectType;
@property (nonatomic, assign) DKCalendarType calendarType;

- (void)selectDate:(NSDate *)date;

- (void)setSelectedDates:(NSArray<NSDate *> *)dates;

- (BOOL)isSelectedDate:(NSDate *)date;

- (NSArray<NSDate *> *)selectedDates;

- (void)clearSelectedItems;

- (NSArray<NSDate *> *)datesFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;

- (DKCalendarCellViewModel *)fetchViewModelWithIndexPath:(NSIndexPath *)indexPath;

// --------------------------

//@property (nonatomic, assign) NSInteger maxSelectCount; // 多选情况下最大可选区间

@property (nonatomic, assign) BOOL hiddenHeaderView;

@end
